check base url before submitting API request