Update delegation example to Lock, parameterize api_type