Minor adjustment to core/api.py