tests on JSON object and some refinement