Create the staged/targets dir if missing

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Fix key JSON serialization

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Export all error fields

Signed-off-by: Lewis Marshall <lewis@lmars.net>