ajax background call logic