We have seen how to write websites that render HTML. How different is this from writing APIs? Place this controller in …