added ts-API and fixes