send error jsons instead of rendering pages or errors