Add API to manage access rights for historic queries.
Improve exception handling