output counter data as proper JSON