adapt main script to apilevel inclusion