Fixed 2 Errors that were caused by UNSET variables

I had to add these changes to my form of the API as I was getting errors on my API calls, simply because there were some unset variables being referenced.