moved signing of data to json_response function