I am trying to get the data out of a ajax success call for use elsewhere in the code. However, the console.log in the last line returns "undefined" for some reason