Fixes the POST and PUT method to handle JSON body data