Unit tests for the function handling the PUT and POST requests