Added url processing to rest.js