Added a queue interface and fixed the backend.py