latest code for server.js changes