Added XML-RPC support and fixed minor bugs