Improve respondDefault404Page and respondDefault500Page to support Ajax