finished aapi sample