API reorganization, basic test for memory implementation added