Fix a bug that put a Content-Type in empty responses.
Fixed a bug in build_url