added more comprehensive tests for api