Added full featured middlewares to contracts. Updated db and resource services to use queueue