Change `getHistory()` to query for a range of dates
Refactor HTTP code to `doQuery()`