fix a bug with json param parsing and add unit test