Ajax: fix parsing response Content-Type from the server

Fixes #699