feat(endpoint): validating the return type and first parameter

Now we ensure that the return type and the first parameter of the endpoint have the
proper types.

Fix #4