format results, handle redirects