auto api environment switcher