Modified API usage of RestGenerationContext API