Updated loadDatabase to return a topic model