don't crash on a null media type, it's just another incorrectly formed media type
add a method to easily compare compatible media types
use MediaType to compare the expected MIME type
use MediaType to check the JSON error type received from the server
use out InputStreamStringParser rather than InputStreamReader