Fixed javascript error when content-type header hasn't been set.
Merge pull request #26 from col/handle_ajax_error

Fixed javascript error when 'content-type' header hasn't been set.