Add some errors handling to actions connected with maps. Code refactor.

Add sid checking as optional functionality to constructor of basic
controller.