Make API thread safe by locking tyrant