added URL redirection and fix for 200 and 204 return codes