Fix get_profiles to handle empty response