Add detect_env to Env class
1. Fix authorization with missing headers 2. Update Env class