Add possibility to set selected state to API