404 instead of 500 on inexistent paths

for tree edit, blame and commits.