Constructor refactor and api end point test cocverage