Added error handling in routes/index.js, and simplified at callback.