What is an API and How Does It Work? A Comprehensive Guide