Add jbuilder templates and improve API.