fixed structure and implemented authentication
finished v1