#15: wrote the JSON serializer for the front end API