generalize apiUrl helper to apiSource, supports both prefixes and config endpoints