Add total feature in API