'Exports methods through the RPC Api.
:param resource: Resource\'s instance to register.
:param filtered: List of methods that *can* be registered. Read
as "Method must be in this list".
:param excluded: List of methods to exclude.
:param refiner: Callable to use as filter for methods.
:raises TypeError: If refiner is not callable.'

def register(self, resource, filtered=None, excluded=None, refiner=None):

    funcs = [x for x in dir(resource) if (not x.startswith('_'))]
    if filtered:
        funcs = [f for f in funcs if (f in filtered)]
    if excluded:
        funcs = [f for f in funcs if (f not in excluded)]
    if refiner:
        funcs = filter(refiner, funcs)
    for name in funcs:
        meth = getattr(resource, name)
        if (not callable(meth)):
            continue
        self._registered[name] = meth
