make api more flexible