modify app.js for api call type