added general API logic