Update api.py

Fix a bug: when the merged result is the same as master, the fields will be a empty list. The empty list is different from `None`.