Add some tests to environment controller
Weird error on tests
Fix tests
Add some api doc
Add tests
Try to DRY up some code