New async API

XXX: some tests don't pass yet