Add key and type check for file/directory JSON payloads
Several endpoints require information on files or directories as JSON objects. When parsing these objects we should check that
- no required key is missing,
- values are of appropriate / expected type and
- no unknown key is provided.
Without these checks semantic errors may occur which are hard to debug / detect (c.f. #19 (closed)).