upadted to handle JSON and javascript response headers. optiona for evaling script tags in html