+ // Trigger a timer to protect from unacceptable long time execution
+ alarm (request->config->apiTimeout);
+ }
+
+ // add client context to request
+ ctxClientGet(request);
+
+ // Effectively call the API with a subset of the context
+ jresp = plugin->apis[idx].callback(request, plugin->handle);
+
+ // API should return NULL of a valid Json Object
+ if (jresp == NULL) {
+ json_object_object_add(jcall, "status", json_object_new_string ("null"));
+ json_object_object_add(request->jresp, "request", jcall);
+ request->errcode = MHD_HTTP_NO_RESPONSE;
+
+ } else {
+ json_object_object_add(jcall, "status", json_object_new_string ("processed"));
+ json_object_object_add(request->jresp, "request", jcall);
+ json_object_object_add(request->jresp, "response", jresp);