Check if function exists in the db or remove it from payload
This MR allows to prevent the use of function IDs that do not exist in the database. It was too complicated to set up from the server side and at the end it makes sure we know what we do as a consumer of the API.
Closes #65