Status Code 500 When Saving a Song to my Library

I have built an app that displays a users top 10 tracks, artists, and 10 most recently played songs and I would like to add a "save to library" button. However whenever I click the button I receive a 500 status code back from the API which the docs define as:

Internal Server Error. You should never receive this error because our clever coders catch them all … but if you are unlucky enough to get one, please report it to us through a comment at the bottom of this page.

I've attached my App.js and function.js files. Function.js is where the code to query the database lives. 

TYIA! Any help is appreciated and have a wonderful holiday.

Child Item
Child Item
Child Item

Accepted answers

All comments

Child Item
Child Item