added method to get JSONObject from a Map.