public static void server(int port, String mapping, String routes, Object api) throws Exception {
ServletContextHandler handler = new ServletContextHandler(ServletContextHandler.SESSIONS);
handler.setContextPath("/");
handler.setAttribute("api", api);
ServletHolder holder = new ServletHolder(new Servlet());
holder.setInitParameter("routes", routes);
handler.addServlet(holder, mapping);
server(port, handler);
}