Add thread variable to api