ApiRelationProvider improvements and safe attributes