improve error handling if application returns bad RDF-JSON document