Fixing bug in serialzing POST requests