added render handlers and separated api