Merged dev into refactor-api. Note that this branch has some remaining issues due to not all calls migrated to api. some remaining calls are broken