Added a Trigger class and moved JSON stuff out of MyController