Connect to db and search for categories