'Wraps a resource (as a flask view function), for cases where the
resource does not directly return a response object
:param resource: The resource as a flask view function'

def output(self, resource):

    @wraps(resource)
    def wrapper(*args, **kwargs):
        resp = resource(*args, **kwargs)
        if isinstance(resp, ResponseBase):
            return resp
        (data, code, headers) = unpack(resp)
        return self.make_response(data, code, headers=headers)
    return wrapper
