Persistable result = Persevere.newObject();
result.put("id", result, id);
if (message instanceof RPCall) {
result.put("object",result,((RPCall) message).getTarget());
result.put("method",result,((RPCall) message).getFunctionName());
result.put("params",result,new PersistableArray(((RPCall) message).getParameters()));
}
else if (message instanceof RPCResponse) {
result.put("result",result,((RPCResponse) message).getResult());
result.put("error",result,((RPCResponse) message).getError());
}