Implemented new REST endpoints for WS.

Untested!
Fixed undefined restify.