Runtime Protection for APIs and Applications