setup api and related tests