if (typeof query.timeframe.end === 'string')
        query.timeframe.end = new Date(query.timeframe.end);