Handle empty API response more gracefully