Cleaned up app.js. Moved all the REST API call handlers and HTML page serving callbacks to controllers/api.js.

Signed-off-by: Natraj Kaushik <natraj.iitb@gmail.com>