Moves the XHR middleware into the core app.
View and app cleanup for the API