fixing to use streaming json
adding some checks in the tests