jesus christ that was a billion times harder than it needed to be. Also, fuck using $.ajax to post json, i forgot about all the little rules involved