Add mutex. Almost finish outer interface