Add tests for API.
Add test that checks that API requests are validated.