adding auth key acquisition from environment plus appropriate script return values (non-zero on error)