Fixing tests broken by error handling changes.

The end-points now return 400 instead of 500 for these errors, as they should.