fix req.xhr issues, and wrap the 500 server error to human readable msg, and add config.js to config the $https head