Add aggregation API support

@tlovett1 #reviewmerge please