My API logic