Added asynchronous callbacks to make it node-friendly.