Used decorators to cleanup endpoint and api