Check for toJson() in option if Handler or AsyncResultHandler

Signed-off-by: Joern Bernhardt <jb@campudus.com>