Added full implementation of the list accounts method