Added API functionality

It can also be more generic as it doesn't only apply to admins (I think I put in this description originally but I was wronngg)