updated server.js to include more methods