I receive the json but don't know how to exit the loop ...