start of lua API