Add a unit test for API