Added historical data query.