add the basic part of lapi.c