class DataNotFoundExceptionMapper implements ExceptionMapper<DataNotFoundException> {

    @Override
    public Response toResponse(DataNotFoundException e) {
        return Response.status(404)
                .type(MediaType.APPLICATION_JSON_TYPE)
                .entity(ImmutableMap.of("code", 404, "message", e.getMessage()))
                .build();
    }

}