code: def post_resource(collection):
      
      cls = endpoint_class(collection)
      resource = cls()
      resource.from_dict(get_resource_data(request))
  
      _validate(cls, request.method, resource)
  
      _perform_database_action('add', resource)
      return resource_created_response(resource)
docs: Return the appropriate *Response* based on adding a new resource to
      *collection*.
  
      :param string collection: a :class:`sandman.model.Model` endpoint
      :rtype: :class:`flask.Response`