error-protect JSON parsing