added some http exception handling