moved API into it's own file, broke out tests into multiple files