helper method to test json