Added error handling and cancel samples
Added download progress class
code style fix