1、add 500 error logic
2、add rewrite function for mapping