Fixed issues with rest service.
Fixed bugs in the rest implementation.