public static void MapRequestToType(string requestKey, Type requestImplementation)
 {
     requestKey = requestKey.Trim().ToUpper();
     if (RequestImplementationMap.ContainsKey(requestKey))
     {
         RequestImplementationMap[requestKey] = requestImplementation;
     }
     else
     {
         RequestImplementationMap.Add(requestKey, requestImplementation);
     }
 }
        public static JSONObject HandleRequest(string requestKey, Dictionary <string, string[]> requestParams)
        {
            requestKey = requestKey.Trim().ToUpper();
            if (requestKey.StartsWith("/"))
            {
                requestKey = requestKey.Substring(1, requestKey.Length - 1);
            }

            if (requestKey.StartsWith("\\"))
            {
                requestKey = requestKey.Substring(1, requestKey.Length - 1);
            }

            if (RequestImplementationMap.ContainsKey(requestKey))
            {
                var req = CreateImplementation(RequestImplementationMap [requestKey]);
                return(req.GetResponseJSON(requestParams));
            }
            else
            {
                return(null);
            }
        }