improve json content type detection

The problem was: Comparing with a hardcoded string is bad because
all the letters can either be uppercase or lowercase or mixed from
a Rest Server. So to check if with a regular expression is more elegant
and reliable.