removed ['SERVER_PORT'] from from_request function, port is otherwise part of the uri