Fix for TypeError thrown when Request params are not objects

It is possible for the request body object to be a string. This will throw a TypeError when attempting to use `Object.keys`. 

This fix adds a typeof check to ensure Object.keys is only used on objects.