I don't know how to create a UI with MayaApi, all I have done in the past is something like this:
import pymel.core as pm
winWidth = 400
if pm.window("window", exists=1): pm.deleteUI("window")
pm.window("window", w=winWidth)
with pm.columnLayout('content', adjustableColumn=True):
with pm.rowColumnLayout(nc=1):
pm.text(l="wooo! A window! ")
However, is there a way to create a UI without the use of pymel?