wrote tests for create-via-api