implement sample app & api fix

there are many bugs.....