code: function(start, end, cb) {
  
            if (typeof start === "function") {
              cb = start;
              start = false;
            } else if (typeof end === "function") {
              cb = end;
              end = false;
            }
  
            if (start instanceof Date) start = start.getTime();
            if (start) qs.from = start;
            if (end instanceof Date) end = end.getTime();
            if (end) qs.to = end;
  
            var opts = {
              url: uri + 'device/'+device+'/data',
              method: 'GET',
              qs: qs,
              json: true
            };
  
            request(opts,function(e,r,b) {
              if (e) cb(e)
              else if (b.result===1) cb(null, b.data)
              else cb({statusCode:b.id||200,error:b.error})
            });
          }
docs: Fetches any historical data about this device.
  Optionally specify the period's `start` and `end`
  timestamp.
  
  Example:
  app.device(guid).data(start, end, function(err, data) { ... })
  
  @param {Integer|Date} start The timestamp/datetime of the beginning of the period
  @param {Integer|Date} end the timestamp/datetime of the end of the period
  @param {Function} cb
  @api public