cleaned up server.js a bit