use api to write friend state on auto accept to db