Added token authentication to the api controller