Added more JSON error handling to cache() and conform()