# Chapter 14: Hacker News API and printing the completion value

**URL:** <https://forums.kodeco.com/t/chapter-14-hacker-news-api-and-printing-the-completion-value/99906>\
**Category:** Combine: Asynchronous Programming with Swift\
**Created:** [February 27, 2020, 6:52pm UTC](https://forums.kodeco.com/t/chapter-14-hacker-news-api-and-printing-the-completion-value/99906 "2020-02-27T18:52:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamieforrest](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jamieforrest/32/88733_2.png) [@jamieforrest](https://forums.kodeco.com/u/jamieforrest)\
**Post date:** [February 27, 2020, 6:52pm UTC](https://forums.kodeco.com/t/chapter-14-hacker-news-api-and-printing-the-completion-value/99906/1 "2020-02-27T18:52:40Z")

</div>

I have copied the code from the book in a Playground, exactly like so:

```auto
func story(id: Int) -> AnyPublisher<Story, Error> {
    URLSession.shared.dataTaskPublisher(for: EndPoint.story(id).url)
      .receive(on: apiQueue)
      .map(\.data)
      .decode(type: Story.self, decoder: decoder)
      .catch { _ in Empty<Story, Error>() }
      .eraseToAnyPublisher()
  }

```

However, when I call the method, the debugger prints `keyPath2()` for the completion rather than `finished`. What am I doing wrong?

```auto
api.story(id: 1000)
  .receive(on: DispatchQueue.main)
  .sink(receiveCompletion: { print($0) }, receiveValue: { print($0) })
  .store(in: &subscriptions)

```

Output:

```auto

How Important is the .com TLD?
by python_kiss
http://www.netbusinessblog.com/2007/02/19/how-important-is-the-dot-com/
-----
keyPath2()

```

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [April 1, 2020, 8:39am UTC](https://forums.kodeco.com/t/chapter-14-hacker-news-api-and-printing-the-completion-value/99906/2 "2020-04-01T08:39:26Z")

</div>

@jamieforrest Do you still have issues with this?
