add coredata support
add protocol for coredata
add delegate method
fix a bug
add NSError to handle the error