refactory http request api