handling http get and post request