add contexts and higher level API