Unify exception raised by invalid input to API endpoints.
This is a first step toward not pickling exceptions.