fix terminal api queries