Added programmatic token generation api.