         searchBar.selectedScopeButtonIndex = -1
         self.searchSuggestionsTable.reloadData()
     }
-
-    func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
-        selectedRow = indexPath.row
-        performSegueWithIdentifier("GoToProductPage", sender: self)
-    }
+    
+    func updateProducts(searchBar: UISearchBar) {
+        
+        var query: String? = nil
+        var emotion: String? = nil
+        if category != "" {
+            emotion = category.lowercaseString
+        }
+        
+        if searchBar.text != "" {
+            query = searchBar.text
+        }
+        
+        activityIndicator.startAnimating()
+        hootAPI.getRealSuggestions(query, emotionText: emotion, completionHandler: {data, error -> Void in
+            self.suggestions = data
+            
+            //self.searchSuggestionsTable.reloadData()
+            dispatch_async(dispatch_get_main_queue(), {
+                self.activityIndicator.stopAnimating()
+                self.searchSuggestionsTable.reloadData()
+            })
+        })
+    }
+    
+    // MARK: Navigation
     
     override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool {
         return selectedRow != nil

        navBar.title = "Hoot"
        super.viewDidLoad()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    func searchBarTextDidBeginEditing(searchBar: UISearchBar) {
        searchBar.enablesReturnKeyAutomatically = false 

        }
    }
    
    // MARK: UITableViewDataSource
    
    func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
