Fix badge pagination payload to return a JSON object with totalCount