# Fin-block crashes when using REST API

**URL:** <https://forums.balena.io/t/fin-block-crashes-when-using-rest-api/360040>\
**Category:** balenaFin\
**Created:** [July 26, 2022, 2:08pm UTC](https://forums.balena.io/t/fin-block-crashes-when-using-rest-api/360040 "2022-07-26T14:08:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![guido](https://avatars.discourse-cdn.com/v4/letter/g/b77776/32.png) [@guido](https://forums.balena.io/u/guido)\
**Post date:** [July 26, 2022, 2:08pm UTC](https://forums.balena.io/t/fin-block-crashes-when-using-rest-api/360040/1 "2022-07-26T14:08:16Z")

</div>

Hello,

I’m trying to read a co-processor gpio pin using the [fin-block](https://github.com/balenablocks/fin-block) but i receive a javascript crash when i send a GET request using the command

> curl -X GET localhost:1337/pin -H “Content-Type: application/json” --data ‘{“pin”: 8}’

but i receive the following output

> The “listener” argument must be of type function. Received undefined

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [July 27, 2022, 10:37am UTC](https://forums.balena.io/t/fin-block-crashes-when-using-rest-api/360040/3 "2022-07-27T10:37:14Z")

</div>

Hello @guido thanks for your message!

I linked internally your message with this Github issue that already existed → [GET/POST pin endpoint is not functioning correctly · Issue #34 · balenablocks/fin-block · GitHub](https://github.com/balenablocks/fin-block/issues/34)

I also pinged the fin-block team but feel free to contribute on the code if you can 🙂
