[API] GenerateToken() stores token server-side

GenerateToken() method has been modified to store the token on the server-side after generation.