Adding condition to Request constructor to allow processing of json requests.