code: function (view, body, api) {
      var self = this
  
      function handleGeneric () {
        return self.send(body)
      }
  
      function handleJSON () {
        return self.json(body)
      }
  
      function handleXML () {
        return self.set('Content-Type', 'application/xml').send(xml(view, body))
      }
  
      function handleHTML () {
        return self.render(view, body)
      }
  
      this.status(200)
  
      if (!body) {
        body = view
        view = undefined
      }
  
      if (typeof body === 'function') {
        body()
      } else {
        this.format({
          text: handleGeneric,
          json: handleJSON,
  
          xml: function () {
            if (view) {
              return handleXML()
            }
  
            return handleGeneric()
          },
  
          html: function () {
            if (view) {
              if (api) {
                return handleXML()
              }
  
              return handleHTML()
            }
  
            return handleGeneric()
          }
        })
      }
    }
docs: Content Helpers