Unit tests for API client.