Add unit tests for some api calls