The `ajax` and `url` part of this function should be in the admin API