         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

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

    @traceAction(req, 'show', "#{@_mount_info.url_prefix}:#{@idParam} format:#{format}")
    id = req.params[@idParam]
    @findOne req, id, (err, item) =>
      # console.log("find returned err:", err, "  item:", item)
      return res.send(500, { error: "#{err}", id: id })  if err
      # return res.json(500, { error: "#{err}", id: id })  if err
      if item is null
        return res.send(404, { error: "Resource not found", id: id })
        # return res.json(404, { error: "Resource not found", id: id })
      obj = @instance2json(item)
      res.json(obj)

