Totals endpoint

First iteration of the totals endpoint.