Added function documentation to server.js