Updated to use json rather than return html markup