Should return error for malformed json