Refactored rest api  and made appropriate modifications to domain objects