added support for using the library internally without calling http calls