Lines 19-23 should probably be separate steps, like `the JSON db entry should contain a directory`, etc. Then if there is a breakage, it is easier to debug later when we know which specific part is broken.