Now checks content headers and defaults to json if appropriate.