added code generation in controller and validator
added code generation for controller and validator