Add exception if environment is not defined
Add tests for config parser