api updated with tests