Added unit tests for API service