switching env api