wip: thinking about refacotring the api so we do not need to pass credentials around.