core/api-spec: prevent races, add direction for cursor updates
core/api-spec: prevent races, add direction for cursor updates

Closes chain/chainprv#1812

chain/chain,chain/chain,chain/chain,chain/chain,chain/chain,chain/chain