Importing search page logic from old project
Database hookup for favorites.