better separate code specific to POST request