api: extract context handling to api/context package
api/context: some tests for api context package
api: context variable to prevent auto app unlock