Add possibility to set and get main material in API

2 jobs for 92-add-materials-probabilities-to-the-entity-table in 3 minutes and 38 seconds (queued for 1 second)