Added unlock and moved locking in a seperate server.
Merge branch 'test' into dev