Update server.js for new REST API