Added logic to extract the target URI from the request. This might not be sound but it Fixes #13