> For the complete documentation index, see [llms.txt](https://docs.langstack.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.langstack.com/welcome/get-started/learn-langstack/introduction-to-rest-api/exercise-1-get-rest-api-and-return-response-object.md).

# Exercise 1: GET REST API & Return Response Object

In this exercise, calculate two numbers through an API.

## Requirements

* The API should support the “GET” method.&#x20;
* Numbers should be passed as a “Query String.”&#x20;
* Return the result with the error code “200” in a JSON format: \
  `{"result": "The result of Addition"}`

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_4/ch4ex1calcflow.png>" %}

To proceed with the exercise, follow the steps below in the solution.&#x20;

{% hint style="info" %}
Note that on encountering text like the following: {username}, replace it with your user initials.
{% endhint %}

## Solution

The solution consists of the following steps:

* Create API
* Test API.
