Rework the API to use a true client-server model.