Changes to server.js to accomodate the server rewrite