Added in the API code I had to do some fixes on. Wont run in current state, but all of the pieces are there.