Cleaned up Core API logic.  Fixed #18