Correcting bugs in app.js and server.js