HOW API WORKS?