Moved events into types and expanded examples & from_api_doc.