refactored to use json format for payload