Added possibility to use controller as a service.