Get categories from db.