add json helper and tests