moves resource API to host, because it's not exclusive to macros