parsing response as json if it is a valid json