move ajax methods to helpers