better handling of http requests