Added assert_valid_json()

Check if returned body is a valid json (and raise exception in other cases).