refactoring api somewhat and reading from it with app