Base code for the API template