Implement number of resources view

Finally, another features has landed. With keep track of a resources
length, I was able to make efficient use of the aggregation framework.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>