Added try-catch block to detect invalid json when a 404 statuscode is returned. Some places do not return json but the exceptionmessage as a string as content. This should fix the problem in #1976
Merge branch 'issue/1976' into develop