diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c
index 59bbb01..20bf6a5 100644
--- a/ospfd/ospf_apiserver.c
+++ b/ospfd/ospf_apiserver.c
@@ -85,12 +85,8 @@
 {
   listnode node;
   struct ospf_interface *oi;
-  struct ospf *ospf;
 
-  ospf = ospf_get ();
-  assert (ospf);
-
-  for (node = listhead (ospf->oiflist); node; nextnode (node))
+  for (node = listhead (ospf_top->oiflist); node; nextnode (node))
     {
       if ((oi = getdata (node)) != NULL
 	  && oi->type != OSPF_IFTYPE_VIRTUALLINK)
@@ -107,12 +103,8 @@
 {
   listnode node;
   struct ospf_interface *oi;
-  struct ospf *ospf;
-  
-  ospf = ospf_get ();
-  assert (ospf);
 
-  for (node = listhead (ospf->oiflist); node; nextnode (node))
+  for (node = listhead (ospf_top->oiflist); node; nextnode (node))
     {
       if ((oi = getdata (node)) && oi->ifp == ifp)
 	{
@@ -1461,6 +1453,27 @@
   u_char options = 0x0;
   u_int16_t length;
 
+  struct ospf *ospf = ospf_top;
+
+#if 0
+  struct ospf *ospf = NULL;
+
+  switch(protolsa->type)
+    {
+    case OSPF_OPAQUE_LINK_LSA:
+      ospf = oi_to_top (oi); /* ospf_opaque.c */
+      break;
+    case OSPF_OPAQUE_AREA_LSA:
+      ospf = area->ospf;
+      break;
+    case OSPF_OPAQUE_AS_LSA:
+      ospf = ospf_top; /* XXX */
+      break;
+    }
+#endif
+
+  assert(ospf);
+
   /* Create a stream for internal opaque LSA */
   if ((s = stream_new (OSPF_MAX_LSA_SIZE)) == NULL)
     {
@@ -1491,7 +1504,7 @@
 
   /* Set opaque-LSA header fields. */
   lsa_header_set (s, options, protolsa->type, protolsa->id, 
-                  area->ospf->router_id);
+                  ospf->router_id);
 
   /* Set opaque-LSA body fields. */
   stream_put (s, ((u_char *) protolsa) + sizeof (struct lsa_header),
@@ -1587,7 +1600,6 @@
 {
   struct msg_originate_request *omsg;
   struct lsa_header *data;
-  struct ospf *ospf;
   struct ospf_lsa *new;
   struct ospf_lsa *old;
   struct ospf_area *area = NULL;
@@ -1597,9 +1609,6 @@
   int ready = 0;
   int rc = 0;
   
-  ospf = ospf_get ();
-  assert (ospf);
-
   /* Extract opaque LSA data from message */
   omsg = (struct msg_originate_request *) STREAM_DATA (msg->s);
   data = &omsg->data;
@@ -1620,7 +1629,7 @@
       lsdb = area->lsdb;
       break;
     case OSPF_OPAQUE_AREA_LSA:
-      area = ospf_area_lookup_by_area_id (ospf, omsg->area_id);
+      area = ospf_area_lookup_by_area_id (ospf_top, omsg->area_id);
       if (!area)
 	{
 	  zlog_warn ("apiserver_originate: unknown area %s",
@@ -1744,11 +1753,13 @@
       ospf_flood_through_area (lsa->area, NULL /*nbr */ , lsa);
       break;
     case OSPF_OPAQUE_AS_LSA:
-      /* Increment counters? XXX */
+      {
+	/* Increment counters? XXX */
 
-      /* Flood LSA through AS. */
-      ospf_flood_through_as (lsa->oi->ospf, NULL /*nbr */ , lsa);
-      break;
+	/* Flood LSA through AS. */
+	ospf_flood_through_as (ospf_top, NULL /*nbr */ , lsa);
+	break;
+      }
     }
 }
 
@@ -1756,7 +1767,7 @@
 ospf_apiserver_originate1 (struct ospf_lsa *lsa)
 {
   /* Install this LSA into LSDB. */
-  if (ospf_lsa_install (lsa->oi->ospf, lsa->oi, lsa) == NULL)
+  if (ospf_lsa_install (ospf_top, lsa->oi, lsa) == NULL)
     {
       zlog_warn ("ospf_apiserver_originate1: ospf_lsa_install failed");
       return -1;
@@ -1866,7 +1877,7 @@
   SET_FLAG (new->flags, OSPF_LSA_SELF);
 
   /* Install LSA into LSDB. */
-  if (ospf_lsa_install (new->area->ospf, new->oi, new) == NULL)
+  if (ospf_lsa_install (ospf_top, new->oi, new) == NULL)
     {
       zlog_warn ("ospf_apiserver_lsa_refresher: ospf_lsa_install failed");
       ospf_lsa_free (new);
@@ -1903,16 +1914,12 @@
 				      struct msg *msg)
 {
   struct msg_delete_request *dmsg;
-  struct ospf *ospf;
   struct ospf_lsa *old;
   struct ospf_area *area = NULL;
   struct in_addr id;
   int lsa_type, opaque_type;
   int rc = 0;
 
-  ospf = ospf_get ();
-  assert(ospf);
-
   /* Extract opaque LSA from message */
   dmsg = (struct msg_delete_request *) STREAM_DATA (msg->s);
 
@@ -1921,7 +1928,7 @@
     {
     case OSPF_OPAQUE_LINK_LSA:
     case OSPF_OPAQUE_AREA_LSA:
-      area = ospf_area_lookup_by_area_id (ospf, dmsg->area_id);
+      area = ospf_area_lookup_by_area_id (ospf_top, dmsg->area_id);
       if (!area)
 	{
 	  zlog_warn ("ospf_apiserver_lsa_delete: unknown area %s",
