 
 public class UserProfile {
     
-    enum Fields: String {
+    enum ProfileFields: String, RawValueExtractable {
         case Image = "profile_image"
         case HasImage = "has_image"
         case ImageURL = "image_url_full"

        
        case LimitedProfile = "limited_profile" //computed field - determined by age & privacy api
        
        func string(json: JSON) -> String? {
            return json[self.rawValue].string
        }
        
        func string(jsonDict: [String: JSON]) -> String? {
            return jsonDict[self.rawValue]?.string
        }
        func bool(jsonDict: [String: JSON]) -> Bool? {
            return jsonDict[self.rawValue]?.bool
        }
        
        func bool(json: JSON) -> Bool? {
            return json[self.rawValue].bool
        }
        
        func int(json: JSON) -> Int? {
            return json[self.rawValue].int
        }
        
        func dictionary(json: JSON) -> [String: JSON]? {
            return json[self.rawValue].dictionary
        }
        
        func array<T : AnyObject>(json: JSON) -> [T]? {
            return json[self.rawValue].arrayObject as? [T]
        }
    }
    
    let hasProfileImage: Bool

    var updateDictionary = [String: AnyObject]()
    
    public init?(json: JSON) {
        let profileImage = json[ProfileFields.Image]
        if let hasImage = profileImage[ProfileFields.HasImage].bool where hasImage {
            hasProfileImage = true
            imageURL = profileImage[ProfileFields.ImageURL].string
        } else {
            hasProfileImage = false
            imageURL = nil
        }
        username = json[ProfileFields.Username].string
        preferredLanguages = json[ProfileFields.LanguagePreferences].arrayObject as? [NSDictionary]
        //            {
        //            preferredLanguages = languages.flatMap { return $0["code"].string }
        //        } else {
        //            preferredLanguages = nil
        //        }
        countryCode = json[ProfileFields.Country].string
        bio = json[ProfileFields.Bio].string
        parentalConsent = json[ProfileFields.ParentalConsent].bool
        birthYear = json[ProfileFields.YearOfBirth].int
    }
    
    var languageCode: String? {
