added api token functionality