proper json encoding in controller actions