Changing some function names also adding logged table to track and create tokens for the Ajax call