now added authentication to api and api sessions