Api function fully commented