I am trying to create a link in my NextJS application that calls an API endpoint to log out a user and end their session, but I can\'t figure out the right pattern to do thi