added flat JSON wrapping