Refactor recording api methods and fix logic

Refactored code of recording api setup, teardown, and
endpoint functions.

Changed Multimedia current_state enum from ints to strs to make some code
in recording api cleaner. Changed a test in test_multimedia.py that
broke as a result.

Fix to recording api logic determining next_id.
Fix to test_server.py teardown to undo patching to media_dict