Second argument is general purpose "environment"

Also removed old commented out section
Test remaining API methods.