Function determineApiUrlAsync