Fixed incorrect reference to API in example.
Functions used before declaration, tempory fix instated.