add error handling to examples
add mkdirp as devdep
better error handling

Close #45