Maybe someone from the community here has more experience with it, but also, I cannot assist Custom Code on Types Plugin.
I can update you with some information:
1. Types can only show Post Types in the REST API yet, using the GUI Only.
2. We have this Plugin here, that is not an officially supported Addon but it was developed to integrate Toolset in the REST API.
Please acknowledge that this plugin receives no support.
3. Eventually, someone from the community who worked with Types and the REST API can help further here.
I am sorry to be of no great help with this custom code.