Declared router helper as service and implemented error handling