Moved app.js
abstracted rest api into it's own piece