'Given some data and a format, calls the correct method to serialize
the data and returns the result.'

def serialize(self, bundle, format=u'application/json', options=None):

    method = None
    if (options is None):
        options = {}
    method = self._to_methods.get(format)
    if (method is None):
        raise UnsupportedSerializationFormat(format)
    return method(bundle, options)
