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`.
Merge pull request #41 from hanfeisun/master

Update api.py