encapsulate search logic in the model and take it out of the controller
Merge pull request #3 from nanditacodes/refactor

encapsulate search logic in the model and take it out of the controller