Fixing an error whereby non-json request bodies were being parsed by JSON.parse