added compiler API; fixed function call bug