Move thread API stuff into client controller