add HandleFunc
add middleware and error handler