refactor code and add NewsAPI
merge api and ui code