Correct URL creation for xmlrpc as well as some error checking