throw 400 errors rather than 500 errors