The RPCHandler now creates json respones and error responses; the JSONObject.write() and JSONArray.write were fixed for the case the internal map/list contains Java null entries. They are silently converted to JSON null now.