Updated code to return response object.