added json_encode to setKey(), setStartKey() and setEndKey()