fixes #3760 - API v2 calculate metadata @total if not explicitly defined