retrieve topics from database