Starting to fill in tests for API + a smidge of implementation