-
-mqtt = null
 
 module.exports = (app) ->
   io = app.io

          res.send 404
        else
          res.json value
      else
        if err?
          res.send "", 404
        else
          res.send "" + data.getValue()


  app.put /^\/topics\/(.+)$/, (req, res) ->
    topic = req.params[0]

    req.session.topics = topics

    Data.find topic, (data, err) ->
      type = req.accepts(['txt', 'json', 'html'])

      if type == "html"
        res.render 'topic.hbs', topic: topic
      else if type == 'json'
        res.contentType('json')
        try
          # if it's a json, we parse it and render
