code: function (json, callback) {
          //validate input
          if (!inputValidation(json)) {
              var inputError = new SearchError('invalid input');
              callback(undefined, inputError);
              return;
          }
          //make end date last millisecond of the day
          var end = new Date(json.date);
          end.setHours(23);
          end.setMinutes(59);
          end.setSeconds(59);
          end.setMilliseconds(999);
          end = end.toISOString();
          //ensure start date is at 00:00:000
          var start = new Date(json.date);
          start.setHours(0);
          start.setMinutes(0);
          start.setSeconds(0);
          start.setMilliseconds(0);
          start = start.toISOString();
  
          database.getSentimentForNameTimeframe(json.character, start, end, function (json, err) {
              if (err) {
                  callback(undefined, err);
              } else {
                  var result = {};
                  var posSentDaily = 0;
                  var negSentDaily = 0;
                  var posDaily = 0;
                  var negDaily = 0;
                  var nullDaily = 0;
                  for (var i in json) {
                      posSentDaily += json[i].posSum;
                      negSentDaily += json[i].negSum;
                      posDaily += json[i].posCount;
                      negDaily += json[i].negCount;
                      nullDaily += json[i].nullCount;
                  }
                  result.character = json[0].character;
                  result.description = json[0].description;
                  result.posSum = posSentDaily;
                  result.negSum = negSentDaily;
                  result.posCount = posDaily;
                  result.negCount = negDaily;
                  result.nullCount = nullDaily;
                  result.date = start;
                  callback(result);
              }
          });
      }
docs: /*
  Gets the score (positive and negative) for a character on a given day
  Input:
  {
  "character" : "Jon Snow",
  "date" : "2016-03-18"
  }