WIP
Fix content type error responses
make json default response type
Stop needlessly passing around response object
Move error logic into endpoint_class() so that other functions don't have to worry about the cls not being in the collection (a 404 will be raised if that's the case, and the rest of their code won't run anyway)
have _validate raise directly rather than making caller know to; remove direct calls to session.get() and use retrieve_resource() instead
fix for tests
redundant line
refactor collection stuff to make use of exiting functions
remove unnecessary request parameter; create consistent name for endpoint functions
remove some redundant code; improve message forwarded from DB errors
Merge branch 'feature/error_content' into develop