update api function to look in different envs dirs