SNAT: move API code to separate file