Ensure all errors returns a parseable body

Returns parsable (either JSON or XML) body in case of error with status
and error information.

Fixes #365
Docstrings and flake8 fixes
Ensure all errors return a parseable body
Merge branch 'rs-parseable-errors' into develop