Added tests for Api constructor, moved non-exported methods into plugins/ folder