Rest-gen modifyRequest

This adds a parameter when creating the api called modifyRequest. It is a function to alter the data of the request just before  performing it. It can be used to, for example, add new headers to the request.