   let firstName: String
   let lastName: String
   let pictureRawURL: String
+
+  init?(json: [String:Any]) {
+    guard
+      let fbid = json["id"] as? String,
+      let displayName = json["name"] as? String,
+      let firstName = json["first_name"] as? String,
+      let lastName = json["last_name"] as? String,
+
+      let picture = json["picture"] as? [String:Any],
+      let picture_data = picture["data"] as? [String:Any],
+      let picture_url = picture_data["url"] as? String
+    else { return nil }
+
+    self.fbid = fbid
+    self.displayName = displayName
+    self.firstName = firstName
+    self.lastName = lastName
+    self.pictureRawURL = picture_url
+  }
 }
 
 enum QueryLimit {

            for serialised in data {
              guard
                let deserialised = serialised as? [String: Any],
                let friend = deserialiseFriend(deserialised)
              else {
                print("unable to deserialise friend \(serialised)")
                continue


class Facebook {
  typealias EnumerationCallback = (_: Friend) -> Void

  private static func enumerateFriends(type: FriendType, limit: QueryLimit,
                                       cursor: String?,
