refactor
add onrequest and onresponse options
release 0.5.11