Endpoint responses to transactions are set up in advance in device firmware.
On receiving an IN token packet, the endpoint responds with ACK, NAK, or data according to how the endpoint is set up, and without requiring firmware intervention. The endpoint then typically will return NAK until firmware sets up a different response to use for a new token packet.
Endpoint zero does control transfers only.