Replaced POST variables with JSON structure