Adding existing API logic