code: def post(self):
      if self.should_fail_with_auth_error() != AuthErrorStates.NONE:
          self.fail_with_auth_error()
          return
  
      try:
          if not self.request.body:
              self.error_out(400, "Input body cannot be empty")
              self.finish()
              return
  
          try:
              request_data = json.loads(
                  self.request.body.decode("utf-8")
              )
          except Exception as ex:
              self.error_out(
                  400, "Failed to decode input body", str(ex)
              )
              self.finish()
              return
  
          if "name" not in request_data:
              self.error_out(
                  400, "name is required to add an endpoint."
              )
              self.finish()
              return
  
          name = request_data["name"]
  
          # check if endpoint already exist
          if name in self.tabpy_state.get_endpoints():
              self.error_out(400, f"endpoint {name} already exists.")
              self.finish()
              return
  
          self.logger.log(logging.DEBUG, f'Adding endpoint "{name}"')
          err_msg = yield self._add_or_update_endpoint(
              "add", name, 1, request_data
          )
          if err_msg:
              self.error_out(400, err_msg)
          else:
              self.logger.log(
                  logging.DEBUG, f"Endpoint {name} successfully added"
              )
              self.set_status(201)
              self.write(self.tabpy_state.get_endpoints(name))
              self.finish()
              return
  
      except Exception as e:
          err_msg = format_exception(e, "/add_endpoint")
          self.error_out(500, "error adding endpoint", err_msg)
          self.finish()
          return
  
file_path: TabPy/tabpy/tabpy_server/handlers/endpoints_handler.py
imports: import json
  import logging
  from tabpy.tabpy_server.common.util import format_exception
  from tabpy.tabpy_server.handlers import ManagementHandler
  from tabpy.tabpy_server.handlers.util import AuthErrorStates
  from tornado import gen
label_desc: Use image node_id 3 for calling the EndpointsHandler obj's underlying member method code with example usage: obj.post() without return types