Added Context object to api. Uses shared state instead of singleton pattern