Add tests for api