resource api cleanup, misc reorg