wrote a code using sinatra for database operations