Under British influence , a monarchy was set up in 1907 ; three years later , a treaty was signed whereby the British agreed not to interfere in Bhutanese internal affairs and Bhutan allowed Britain to direct its foreign affairs .