Update rest.js

Now it's tested, and it's working. (Tested only Listing and Getting)