CORE-2243 fixed create task api call

@PurnimaGS  add null validation check