Refactoring and added default params

Using define_method than instance_exec in base controller
Added default fields like ip, parameters and route