First version of api
removed debug traces