Fix path selection for apis in subdomains