changed api to env