Removed commented out lines
Use json_encode rather than serialize