Fix scrolling bug when you do a new search
Fix NSInteger warning
Make sure api completion blocks are called on the main thread.