As Facebook grapples with the misuse of some 50 million users’ data — a pilferage that rocked American democracy, created turmoil in the social network’s executive ranks and cost investors almost $50 billion — it’s worth asking how the Menlo Park company got into this mess.The answer lies in what it calls Facebook Platform, the online interfaces through which businesses access user data and publish links and other material to the social network.