Add server function in server.js