added option to pass custom API URL on construct for debugging purpose