adding locking on serializing entire library and loading library from json so multiple concurrent requests can be accepted