fixed logic to check if an API request with payload had the content-type header as application/json