AJAX connection management for flux