ast api: implementation