what are the duties and functions of an agent