indented backend code and fixed enconding issues