Created search controller and added validation