Converts the post data to JSON and then to the correct payload structure