<prompt> Kuandika API kupata idadi ya kwanza ijayo  <response>: Here is an example of a simple API in Python that takes an integer as input and returns the next prime number:pythonfrom flask import Flask, jsonifyapp Flask__name__def is_primenum: if num 1: return False for i in range2, num: if num i 0: return False return Truedef get_next_primenum: next_prime num 1 while not is_primenext_prime: next_prime 1 return next_primeapp.routenextprime, methodsGETdef next_primenum: try: next_prime get_next_primenum return jsonifynext_prime: next_prime except ValueError: return jsonifyerror: Invalid input, please enter an integerif __name__ __main__: app.runThis API defines two functions is_prime and get_next_prime which are used to check if a number is prime and to find the next prime number respectively. The API utilizes the Flask web framework to create an endpoint nextprime that accepts an integer as input and returns the next prime number in JSON format. The API also includes error handling to return an error message in case the input is invalid. 