sessions and api