Move Header.Set() above WriteHeader

Fix content type issue