fix environment modeling and changed api to lock/unlock environment
Merge pull request #209 from garaemon/fix-environment-modeling

fix environment modeling and changed api to lock/unlock environment