added terminal condition for ajax request counter, added way to push data