Auto generate api method.