return errors and status code 422 when invalid post request