Decouple controller's logic with JSON