switched token to server based implementation