Pruned down server.js functionality