Fixed server tests after modifying REST API.
WIP: client unit tests.
Fixing REST API on client side.
Fixing REST API on client side.

- Also adding unit tests for client services.
Fixing REST API on client side.
Fixing REST API on client side.
Fixing REST API on client side.
fixes after testing.