api: add functions to retrieve auth handler and server from a gin.Context
add html index page when not authenticated fixed auth's handling of empty permissions