Builds out initial publish and subcribe functions