added gencode initialisation to API