Adding null conditions in rest api object conversion logic