Refactored sample app to cater for new api methods