Added functions into server.js