Add tests for client and api