Creating Rest Api Endpoints In Python A Function