migrate ajax to views