REST: Add newline to response when using pretty flag
closes #3748
relates to #3422