built out the API and corresponding tests