Studying and Leveraging API Usage Patterns