finishing the model work for search functionality