Move os.GetEnv stuff out of api