fix($http): honor application/json response header and parse json primitives

When server responds with Content-Type header set to application/json we now properly parse the response as JSON

Closes #2973