Prevent crashes on API errors.