implemented environment type test/production to run in test or live mode