Make timeout configurable and default to 30s
Handle redirects properly