Add API tests and fix some bugs
- Adds tests for all the API endpoints to verify that they are working correctly
- Fixes a bunch of bugs in the V1 endpoints so they would return 400s instead of 500s for most errors
- Adds input validation for all other API endpoints so invalid requests return 422 with info on what is missing.
Edited by Callum Dickinson