Modified logic for http responses, removed puts calls