Deque API implementation