added unit tests to api client