Refactored request response format code.

Signed-off-by: Seemant Rajvanshi <seemant.rajvanshi@gmail.com>