Storing the pending_op id to retrieve it after a reload
Fixing mongo query to pass correct parameters
Using relationships for on_domains and completed_domains