Make ApiListener work more reliable