Fixing status code and hostname in redirect, addint host option, updating tests