Added ability to detect whether the JSON file cannot be parsed