fix: dispatch api.connect() setup onto the reactor thread (#192) (#379)