use valueForKeyPath to enable input dictionaries that need to access nested values
added a check for nil and NSNull in addWithDictionary