curl does not fail by default. it downloads the 404 error page instead so we need add -f option to curl.