code: def CallApiHandler(handler, args, token=None):
      
  
      result = handler.Handle(args, token=token)
  
      expected_type = handler.result_type
      if expected_type is None:
        expected_type = None.__class__
  
      if result.__class__ != expected_type:
        raise UnexpectedResultTypeError(
            "Expected %s, but got %s." %
            (expected_type.__name__, result.__class__.__name__))
  
      return result
docs: Handles API call to a given handler with given args and token.