code: function cleanup() {
        res.removeListener('finish', sendStats);
        res.removeListener('error', cleanup);
        res.removeListener('close', cleanup);
      }
docs: Function to clean up the listeners we've added