api and tokens management