def suffix(handlers, default=None, error='The requested suffix does not match any of those allowed'):
    """Returns a content in a different format based on the suffix placed at the end of the URL route
       should pass in a dict with the following format:

            {'[suffix]': action,
             ...
            }
    """
    def output_type(data, request, response):
        path = request.path
        handler = default
        for suffix_test, suffix_handler in handlers.items():
            if path.endswith(suffix_test):
                handler = suffix_handler
                break

        if not handler:
            raise falcon.HTTPNotAcceptable(error)

        response.content_type = handler.content_type
        return handler(data, request=request, response=response)
    output_type.__doc__ = 'Supports any of the following formats: {0}'.format(', '.join(function.__doc__ for function in
                                                                                        handlers.values()))
    output_type.content_type = ', '.join(handlers.keys())
    return output_type
Returns a content in a different format based on the suffix placed at the end of the URL route
       should pass in a dict with the following format:

            {'[suffix]': action,
             ...
            }