-static int api_ws_server_req_subscribe(struct api_ws_server_req *wreq, struct afb_event event);
-static int api_ws_server_req_unsubscribe(struct api_ws_server_req *wreq, struct afb_event event);
-static void api_ws_server_req_subcall(struct api_ws_server_req *wreq, const char *api, const char *verb, struct json_object *args, void (*callback)(void*, int, struct json_object*), void *closure);
+
+static struct json_object *api_ws_server_req_json_cb(void *closure);
+static struct afb_arg api_ws_server_req_get_cb(void *closure, const char *name);
+static void api_ws_server_req_success_cb(void *closure, struct json_object *obj, const char *info);
+static void api_ws_server_req_fail_cb(void *closure, const char *status, const char *info);
+static const char *api_ws_server_req_raw_cb(void *closure, size_t *size);
+static void api_ws_server_req_send_cb(void *closure, const char *buffer, size_t size);
+static void api_ws_server_req_addref_cb(void *closure);
+static void api_ws_server_req_unref_cb(void *closure);
+static int api_ws_server_req_subscribe_cb(void *closure, struct afb_event event);
+static int api_ws_server_req_unsubscribe_cb(void *closure, struct afb_event event);
+static void api_ws_server_req_subcall_cb(void *closure, const char *api, const char *verb, struct json_object *args, void (*callback)(void*, int, struct json_object*), void *cb_closure);