Refactored to use a custom Sinatra server