fixing bugs in non-xml API