Make api more general