code: def handle_ajax_request(self):
          
          # check if the method exists
          func_arg = self.traverse_subpath[0]
          func_name = "ajax_{}".format(func_arg)
          func = getattr(self, func_name, None)
  
          if func is None:
              return self.fail("Invalid function", status=400)
  
          # Additional provided path segments after the function name are handled
          # as positional arguments
          args = self.traverse_subpath[1:]
  
          # check mandatory arguments
          func_sig = inspect.getargspec(func)
          # positional arguments after `self` argument
          required_args = func_sig.args[1:]
  
          if len(args) < len(required_args):
              return self.fail("Wrong signature, please use '{}/{}'"
                               .format(func_arg, "/".join(required_args)), 400)
          return func(*args)
docs: Handle requests ajax routes