added the request variable to rest callbacks.