Change caught ValueError to KeyError, add tests to produce 422 errors