Javascript Call Async Function From Synchrony