added method of main controller which is getting data from view and started search