Cleanup of various debug functions and variables, and additional REST calls implemented