api: refactor api data storage

single struct to hold all api handler, flags, etc.
Provide functions to toggle flags instead of writing directly to
internal data.

Type: refactor
Change-Id: I4730d7290e57489de8eda34a72211527e015b721
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vnet/l2/l2_api.c b/src/vnet/l2/l2_api.c
index 5a0432d..c555a17 100644
--- a/src/vnet/l2/l2_api.c
+++ b/src/vnet/l2/l2_api.c
@@ -1281,7 +1281,7 @@
   api_main_t *am = vlibapi_get_main ();
 
   /* Mark VL_API_BRIDGE_DOMAIN_DUMP as mp safe */
-  am->is_mp_safe[VL_API_BRIDGE_DOMAIN_DUMP] = 1;
+  vl_api_set_msg_thread_safe (am, VL_API_BRIDGE_DOMAIN_DUMP, 1);
 
   /*
    * Set up the (msg_name, crc, message-id) table