make api and edit api give a component object