Index: wp-includes/admin-bar.php
===================================================================
--- wp-includes/admin-bar.php	(revision 21813)
+++ wp-includes/admin-bar.php	(working copy)
@@ -730,7 +730,7 @@
 	global $show_admin_bar, $pagenow;
 
 	// For all these types of requests, we never want an admin bar.
-	if ( defined('XMLRPC_REQUEST') || defined('APP_REQUEST') || defined('DOING_AJAX') || defined('IFRAME_REQUEST') )
+	if ( defined('XMLRPC_REQUEST') || defined('DOING_AJAX') || defined('IFRAME_REQUEST') )
 		return false;
 
 	// Integrated into the admin.
Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 21813)
+++ wp-includes/post.php	(working copy)
@@ -4670,9 +4670,8 @@
  * @since 2.3.0
  * @access private
  * @uses $wpdb
- * @uses XMLRPC_REQUEST and APP_REQUEST constants.
+ * @uses XMLRPC_REQUEST constant.
  * @uses do_action() Calls 'xmlprc_publish_post' on post ID if XMLRPC_REQUEST is defined.
- * @uses do_action() Calls 'app_publish_post' on post ID if APP_REQUEST is defined.
  *
  * @param int $post_id The ID in the database table of the post being published
  */
@@ -4681,8 +4680,6 @@
 
 	if ( defined('XMLRPC_REQUEST') )
 		do_action('xmlrpc_publish_post', $post_id);
-	if ( defined('APP_REQUEST') )
-		do_action('app_publish_post', $post_id);
 
 	if ( defined('WP_IMPORTING') )
 		return;
Index: wp-includes/pluggable-deprecated.php
===================================================================
--- wp-includes/pluggable-deprecated.php	(revision 21813)
+++ wp-includes/pluggable-deprecated.php	(working copy)
@@ -168,3 +168,22 @@
 else :
 	_deprecated_function( 'wp_login', '2.5', 'wp_signon()' );
 endif;
+
+/**
+ * WordPress AtomPub API implementation.
+ *
+ * @since 2.2.0
+ * @deprecated 3.5.0
+ *
+ */
+if ( ! class_exists( 'wp_atom_server' ) ) {
+	class wp_atom_server {
+		public function __call( $name, $arguments ) {
+			_deprecated_function( __CLASS__ . '::' . $name, '3.5', 'the Atom Publishing Platform plugin' );
+		}
+		
+		public static function __callStatic( $name, $arguments ) {
+			_deprecated_function( __CLASS__ . '::' . $name, '3.5', 'the Atom Publishing Platform plugin' );
+		}
+	}
+}
\ No newline at end of file
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 21813)
+++ wp-includes/functions.php	(working copy)
@@ -1910,8 +1910,6 @@
 		$function = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' );
 	elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST )
 		$function = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' );
-	elseif ( defined( 'APP_REQUEST' ) && APP_REQUEST )
-		$function = apply_filters( 'wp_die_app_handler', '_scalar_wp_die_handler' );
 	else
 		$function = apply_filters( 'wp_die_handler', '_default_wp_die_handler' );
 
Index: wp-includes/rewrite.php
===================================================================
--- wp-includes/rewrite.php	(revision 21813)
+++ wp-includes/rewrite.php	(working copy)
@@ -1527,7 +1527,9 @@
 
 		// Old feed files
 		$old_feed_files = array( '.*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$' => $this->index . '?feed=old' );
-
+		// Old service files
+		$old_service_files = array( '.*wp-app\.php$' => $this->index . '?error=403' );
+		
 		// Registration rules
 		$registration_pages = array();
 		if ( is_multisite() && is_main_site() ) {
@@ -1585,9 +1587,9 @@
 
 		// Put them together.
 		if ( $this->use_verbose_page_rules )
-			$this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $old_feed_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite,  $author_rewrite, $date_rewrite, $page_rewrite, $post_rewrite, $this->extra_rules);
+			$this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $old_feed_files, $old_service_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite,  $author_rewrite, $date_rewrite, $page_rewrite, $post_rewrite, $this->extra_rules);
 		else
-			$this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $old_feed_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite,  $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules);
+			$this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $old_feed_files, $old_service_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite,  $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules);
 
 		do_action_ref_array('generate_rewrite_rules', array(&$this));
 		$this->rules = apply_filters('rewrite_rules_array', $this->rules);
Index: wp-includes/class-wp.php
===================================================================
--- wp-includes/class-wp.php	(revision 21813)
+++ wp-includes/class-wp.php	(working copy)
@@ -195,7 +195,7 @@
 					$query = $rewrite['$'];
 					$matches = array('');
 				}
-			} else if ( $req_uri != 'wp-app.php' ) {
+			} else {
 				foreach ( (array) $rewrite as $match => $query ) {
 					// If the requesting file is the anchor of the match, prepend it to the path info.
 					if ( ! empty($req_uri) && strpos($match, $req_uri) === 0 && $req_uri != $request )
@@ -228,11 +228,13 @@
 
 				// Parse the query.
 				parse_str($query, $perma_query_vars);
-
-				// If we're processing a 404 request, clear the error var
-				// since we found something.
-				unset( $_GET['error'] );
-				unset( $error );
+				
+				if ( '404' == $error ) {
+					// If we're processing a 404 request, clear the error var
+					// since we found something.
+					unset( $_GET['error'] );
+					unset( $error );
+				}
 			}
 
 			// If req_uri is empty or if it is a request for ourself, unset error.
@@ -325,11 +327,15 @@
 
 		if ( is_user_logged_in() )
 			$headers = array_merge($headers, wp_get_nocache_headers());
-		if ( !empty($this->query_vars['error']) && '404' == $this->query_vars['error'] ) {
-			$status = 404;
-			if ( !is_user_logged_in() )
-				$headers = array_merge($headers, wp_get_nocache_headers());
-			$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
+		if ( ! empty( $this->query_vars['error'] ) ) {
+			$status = (int) $this->query_vars['error'];
+			if ( in_array( $status, array( 403, 500, 502, 503 ) ) ) {
+				$exit_required = true;
+			} elseif ( 404 === $status ) {
+				if ( ! is_user_logged_in() )
+					$headers = array_merge($headers, wp_get_nocache_headers());		
+				$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
+			}
 		} else if ( empty($this->query_vars['feed']) ) {
 			$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
 		} else {
Index: xmlrpc.php
===================================================================
--- xmlrpc.php	(revision 21813)
+++ xmlrpc.php	(working copy)
@@ -42,7 +42,7 @@
       <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
       <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
       <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
-      <api name="Atom" blogID="" preferred="false" apiLink="<?php echo site_url('wp-app.php/service', 'rpc') ?>" />
+      <?php do_action( 'xmlrpc_rsd_apis' ); ?>
     </apis>
   </service>
 </rsd>
Index: wp-admin/includes/schema.php
===================================================================
--- wp-admin/includes/schema.php	(revision 21813)
+++ wp-admin/includes/schema.php	(working copy)
@@ -444,7 +444,6 @@
 
 	// 2.6
 	'avatar_default' => 'mystery',
-	'enable_app' => 0,
 
 	// 2.7
 	'large_size_w' => 1024,
@@ -542,7 +541,7 @@
 		'_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins',
 		'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron',
 		'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page',
-		'wporg_popular_tags', 'what_to_show', 'rss_language', 'language', 'enable_xmlrpc',
+		'wporg_popular_tags', 'what_to_show', 'rss_language', 'language', 'enable_xmlrpc', 'enable_app',
 	);
 	foreach ( $unusedoptions as $option )
 		delete_option($option);
Index: wp-admin/options.php
===================================================================
--- wp-admin/options.php	(revision 21813)
+++ wp-admin/options.php	(working copy)
@@ -64,7 +64,7 @@
 	'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', 'embed_autourls', 'embed_size_w', 'embed_size_h' ),
 	'privacy' => array( 'blog_public' ),
 	'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ),
-	'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format', 'enable_app' ),
+	'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format' ),
 	'options' => array( '' ) );
 
 $mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass');
Index: wp-admin/options-writing.php
===================================================================
--- wp-admin/options-writing.php	(revision 21813)
+++ wp-admin/options-writing.php	(working copy)
@@ -168,19 +168,13 @@
 </table>
 <?php } ?>
 
+<?php if ( isset( $GLOBALS['wp_settings_fields']['writing']['remote_publishing'] ) ): ?>
 <h3><?php _e('Remote Publishing') ?></h3>
 <p><?php printf(__('To post to WordPress from a desktop blogging client or remote website that uses the Atom Publishing Protocol or one of the XML-RPC publishing interfaces you must enable them below.')) ?></p>
 <table class="form-table">
-<tr valign="top">
-<th scope="row"><?php _e('Atom Publishing Protocol') ?></th>
-<td><fieldset><legend class="screen-reader-text"><span><?php _e('Atom Publishing Protocol') ?></span></legend>
-<label for="enable_app">
-<input name="enable_app" type="checkbox" id="enable_app" value="1" <?php checked('1', get_option('enable_app')); ?> />
-<?php _e('Enable the Atom Publishing Protocol.') ?></label><br />
-</fieldset></td>
-</tr>
 <?php do_settings_fields('writing', 'remote_publishing'); ?>
 </table>
+<?php endif ?>
 
 <?php if ( apply_filters( 'enable_update_services_configuration', true ) ) { ?>
 <h3><?php _e('Update Services') ?></h3>
