Modification to handle bad json request

Modification to handle bad json request