Update rest.js

Two small mistakes, now it's finally working :)