added the re-factored api