API: Fix a 500 error on GET /files/fid/metadata when using an unknown fid
API: Fix a 500 error when using GET /entries/(name) with an unknown entry
Update the docs to fit new fid system.

- Erase useless calls to string upper() method.
  Replace a dict keys iterator unrolling by a next(iter(dict.keys())).

- Fix some minor style issues in the tests.
  Adapt the tests to the absence of upper().