more changes to support new api format