fix the POST and PUT methods