Metadata JSON errors are caught and error reported back to caller; the display.js file also handles the possible errors
Added a separate error message for the case of a syntactically incorrect template in Javascript.