set content-type on ocs exceptions

Conflicts:
	lib/api.php
fixing method names
Merge pull request #7691 from owncloud/backport-7683-stable5

Backport 7683 stable5