[MOD] REST, Locking: rewritings, test added (#666)