added cache and curl function