Updated rest.js file