Add functionality and routes to server.js