fix some bugs and make sure all old apis are redirected to right place