Make download() return status code: A lib shouldn't terminate the running application if something goes wrong.