Reusing a jquery AJAX call before another AJAX call