add api/bgapi event functions
auto subscribe to background_job when use bgapi
redirect /portal to /portal/index.html