Fixed core data bug and used NSURLSession