moved API definitions into global variables