initial diary controller and logic, not working on frontend