add a reduce function to easily count request types