fixed search and categories

Here is a version fixing the Search and using the topic API to produce categories