Move to sync api.

Fixes #11