Added a serializeAttribute method for RPC calls