code: def load_categories(self, max_pages=30):
          logger.info("loading categories")
          if self.purge_first:
              Category.objects.filter(site_id=self.site_id).delete()
          path = "sites/{}/categories".format(self.site_id)
          params = {"number": 100}
          page = 1
          response = self.get(path, params)
          if not response.ok:
              logger.warning("Response NOT OK! status_code=%s\n%s", response.status_code, response.text)
          while response.ok and response.text and page < max_pages:
              logger.info(" - page: %d", page)
              api_categories = response.json().get("categories")
              if not api_categories:
                  break
              categories = []
              for api_category in api_categories:
                  existing_category = Category.objects.filter(site_id=self.site_id, wp_id=api_category["ID"]).first()
                  if existing_category:
                      self.update_existing_category(existing_category, api_category)
                  else:
                      categories.append(self.get_new_category(api_category))
              if categories:
                  Category.objects.bulk_create(categories)
              elif not self.full:
                  break
              page += 1
              params["page"] = page
              response = self.get(path, params)
              if not response.ok:
                  logger.warning("Response NOT OK! status_code=%s\n%s", response.status_code, response.text)
                  return