Api modification for handling pdf