         if (not related.idParam of item) or (not item[related.idParam])
           item[related.idParam] = related_id
     item.save (err) =>
-      return res.json(500, { error: "#{err}", id: id })  if err
-      console.log("created #{@name} with id:#{item.id}")
+      return res.send(500, { error: "#{err}", id: id })  if err
+      #console.log("created #{@name} with id:#{item.id}")
       if (req.body._format? and req.body._format == 'html') or (format == 'html')
         return res.redirect @_mount_info.url_prefix + "/#{item.id}" + ".html"
       else

    @traceAction(req, 'index', "#{@_mount_info.url_prefix} format:#{format}")
    q = @_build_query(req)
    q.exec (err, items) =>
      return res.json(500, { error: "#{err}" })  if err
      objs = items.map (item) => @instance2json(item)
      res.json(objs)


    defaultFormat: 'json'
    actions: {}
    addLinks: true
    trace: false
  _DEFAULT_OPTION_ACTIONS:
      index: {}
      create: {}
