Feature/unit tests

more unit tests and slight changes in controllers.