Improve error reporting in HTTP and JSON files