latest fixes from testing on tw-merge

there are two changes to the ApiHelper that I am not sure about but they fix a problem currently on tw-merge.