exposing some api via some hacks. This need to be thrown away and rewritten