Fix JsonEncode/Decode, error detection

* jsonDecode & jsonEncode - recodes 1-based to 0-based
* getRawParameter() - better parameter error detection

Change-Id: I1d7376358fa70805fc9dbb02f535eeb7ef4ec5ed