type checking
make some function becomes template functions. Someday will try to implement a version for class(data) == "environment"
correct test for new API
correct C APi