Improved exception handling in the api
#598 Small fix in apiv2 docs
Bugfix in permission_granted view in apiv2