Return the aggregation type in the response

PR for #5867