restored the gateway functionality - now using async APIs