Added improved error reporting to BoxText
Added the APISetVariable call