some more fixes and cleanups in server.js