Wrap elementAPI code in try...catch braces