app.js with ajax calls to the api