created homepage and refactored the code to more json way