#588 database and interfaces change
#589 api and model changes
#589 #573 sample app change