Made JSON backend slightly more threadsafe