api is not thread safe