'Initialize Resource.
:param controller: object that implement methods created by routes lib
:param action_peek: dictionary of routines for peeking into an action
request body to determine the desired action'

def __init__(self, controller, action_peek=None, **deserializers):

    self.controller = controller
    default_deserializers = dict(json=JSONDeserializer)
    default_deserializers.update(deserializers)
    self.default_deserializers = default_deserializers
    self.default_serializers = dict(json=JSONDictSerializer)
    self.action_peek = dict(json=action_peek_json)
    self.action_peek.update((action_peek or {}))
    self.wsgi_actions = {}
    if controller:
        self.register_actions(controller)
    self.wsgi_extensions = {}
    self.wsgi_action_extensions = {}
