completed contextual API, missing only improved refresh algorithm, added
authorization control to contextual api