Can't set headers after they are sent. on second call to REST API using Node and express

I am getting below ERROR while making a RESTFUL API call created using Node and express,

Note: For the 1st call i got JSON response as expected. When try to hit 2nd time i got this ERROR.

  http.js:704
    throw new Error('Can\'t set headers after they are sent.');
          ^
Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (http.js:704:11)
    at ServerResponse.res.setHeader (/Users/rain/node-js-sample/node_modules/express/node_modules/connect/lib/patch.js:62:20)
    at ServerResponse.res.header (/Users/rain/node-js-sample/node_modules/express/lib/response.js:280:8)
    at ServerResponse.res.json (/Users/rain/node-js-sample/node_modules/express/lib/response.js:135:8)
    at EventEmitter.<anonymous> (/Users/rain/node-js-sample/web.js:82:11)
    at EventEmitter.emit (events.js:117:20)

Server code,

app.get('/service/:id/:startDate/:endDate', function(req, res) {
  if(req.params.id.length <= 0 || req.params.startDate.length <= 0 || req.params.endDate.length <= 0) {
    res.statusCode = 404;
    res.send('Error 404: Invalid start date or end date provided');
  } else {
    rest.get("http://localhost:8080/service/" + req.params.chartId  + 
      "/" + req.params.startDate +
      "/" + req.params.endDate).on('complete', function(data, response) {
      console.log(data);
      res.json(data);
    });
  }
});

I found a workaround. After converting JSON response to string. It worked.

res.send(JSON.stringify(data));