Learning to handle JSON and HTTP requests with Sinatra