Corrected urls and code to handle htc requests.