Refactoring request handlers out of server.js