Add lock-related APIs

Need to add more tests