Fixing REST API on client side.

- Also adding unit tests for client services.