Remove app.js and move logic to search controller