The setavatar.php can't be factored into avatar.php, as this is way different functionality.
How do I do DELETE requests in js?