Updated app.js with controller