Added tests, API behaves as it should