Change logic controller to lib
Change errors messages logic on controllers to lib