Free prng in bdgr_key_import() and correctly report json errors in bdgr_badge_import