make JSON parsing dependent on contentType