Following code are repeating in several places, consider to put to a function
```
JSONObject jsonMsgRet = new JSONObject();
jsonMsgRet.put("_promise_id", _promise_id);
JSONObject jsData = new JSONObject();
jsonMsgRet.put("data", jsData);
jsData.put("error", false);
JSONObject jsBody = new JSONObject();
jsData.put("body", jsBody);
```