Add json decode capability
Fix errors for empty params and responses