Fixed bug where constants in an API are frozen, but subelements werent.
Now recursively freezes objects