def METHOD_NAME(self):
    content_length = int(self.headers['Content-Length'])
    body = self.rfile.read(content_length)
    request = json.loads(body)
    path = list(reversed(self.path.strip('/').split('/')))
    if path.pop() != 'platform':
        raise Exception("invalid path " + self.path)
    obj = platform
    while len(path) != 1:
        _dir = path.pop()
        # TODO: Clean this up once we no longer need to support Python 2
        if sys.version_info.major == 3:
            args = inspect.getfullargspec(getattr(obj, 'get_' + _dir)).args
        else:
            args = inspect.getargspec(getattr(obj, 'get_' + _dir)).args
        if 'index' in args:
            _idx = int(path.pop())
            obj = getattr(obj, 'get_' + _dir)(_idx)
        else:
            obj = getattr(obj, 'get_' + _dir)()
    api = path.pop()
    args = request['args']
    res = None
    try:
        res = getattr(obj, api)(*args)
    except NotImplementedError:
        syslog.syslog(syslog.LOG_WARNING, "API '{}' not implemented".format(api))
    self.send_response(200)
    self.send_header('Content-Type', 'application/json')
    self.end_headers()
    self.wfile.write(json.dumps({'res': res}, default=obj_serialize).encode('utf-8'))