making strong progress, should make sending json a function somehow?