Api.php line 73 tries to get the ID from the global $post object, without first checking if the $post object exists.
On initial load of post-new.php, there is no post object, and thus WP errors out if WP_DEBUG is on.
Can fix by changing to
if ( !$post )
$post_id = $post->ID;