Add code documentation
Update to harden external facing interfaces