two functions index and search in the controller has been created