fix crash on faulty API response