Fix url request handling so that uri is properly parsed. Added additional section in debugging.