Added merchant controller endpoints and simple refactoring