optimized evaluation of api base path