refactored most of the code, split app/api into separate routes, styling