Better error reporting on some api endpoints