Intigrated backend algorithm with ajax