added media to json response and deserialize media in request