class RestRules {

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Response list() {
        RestListener listener = RestManager.getListener();
        Response response;

        try {
            List<Map<String, Object>> list = listener.list();
            log.info("List request {}", list);
            response = Response.ok().entity(list).build();
        } catch (Exception e) {
            e.printStackTrace();
            response = Response.serverError()
                    .entity(toMap(e, Response.Status.INTERNAL_SERVER_ERROR))
                    .build();
        }

        return response;
    }

}