Moved URI and document queue to database