make JSON-methods more failsafe