adding support for HTTP redirects

This change adds supports for HTTP redirects. When a 302 is returned from Nest servers, the code will follow the new URL.