add support for average, max, min, and sum aggregate query options
add groupBy functionality