Refactor SwaggerResourceService into a class under api package