Refactored API and created some tests for duplicated person