add handler for API