Beginnings of porting API code.