404 instead of 500 on inexistent paths

for tree edit and blame show