Writing unit tests for API endpoints

Writing unit tests for API endpoints