fix namespace hierarchy and inheritance on API level

CPI level needs to be done, still.