Imrpovement of the download function
Addition of the HTTP error support