How to find out when multiple XMLHttpRequest are finished?