added auto_write endpoints functionality