added expect_json_length method