VerifyOrSet API second commit

1: have used verifyAndSwap as an example to convert verifyOrSet.
VerifyOrSet API