Added CoreData related code

Added CoreData related code