Added MongoDB aggregate functions to API