Move the render_index() function out of the constructor and use add_url_rule() instead of the route() decorator to connect it to Flask.
Add signals.on_rpc().
Refector init_app() function into an App class.