Fix setup s2 environment for api use