Moved respond_with_404 and 500 to easier to use functions.
Removed unused rmutex.