Added unit test for API