refactor server.js tests