Fixed, formatting, added local json

Fixed the formatting of the functions in app.js so it should be easier
to read. Added ajax calls so that there should always be data in the
app.