Fixed request url and made logging a tad more robust