In this version I tried to improve the handling of 404 errors from my experience so far.