Add "user roles" endpoint to the API

Much of this code was moved from the management app