Implement token-base authentication for api