Clean up app.rb and use json instead of .to_json