Implementation of the Raft API.