(fix) Return 404 response, if file was not found

I'm not too happy about this implementation, but I don't really know how
to improve it. I've added comments explaining my misgivings.
Improve error handling code

This fixes one of the warts from the last commit that I was unhappy
about.