complete rewrite and adding a xmlrpc version