fixes error template path and updated to use separate CLI and server contexts

This should fix the error template path, which is only set for the CLI now, vs. server instances.