code: def generate_endpoint_classes(db, generate_pks=False):
      
      seen_classes = set()
      for cls in current_app.class_references.values():
          seen_classes.add(cls.__tablename__)
      with app.app_context():
          db.metadata.reflect(bind=db.engine)
          for name, table in db.metadata.tables.items():
              if not name in seen_classes:
                  seen_classes.add(name)
                  if not table.primary_key and generate_pks:
                      cls = add_pk_if_required(db, table, name)
                  else:
                      cls = type(
                          str(name),
                          (sandman_model, db.Model),
                          {'__tablename__': name})
                  register(cls)
docs: Return a list of model classes generated for each reflected database
      table.