added api = true option to return the component