feature(rest) add request.on error
write -> save
refactor(rest) name -> path.basename(name)