Update rest.js

Changed to fix broken field select.