fixes to server.js to get the login working