Improvements on resource loading.

Improve resource loading (enabling parallel resource loading).
Fix some bugs related to unexpected 404 redirects and missing redirects to error page when api server is down.