How many hrs police can keep a citizen in custody without case

Once I was arrested by police and kept in cell for more than 12 hrs. I just said Hai to An ex-girl friend of mine when she was walking on the road. I was about to ask to return my money back(about 2 lakhs) as I was needy. 2 days before this incident, I had called her to ask for money. But she disconnected the phone before I could ask her. She thought that I came to ruin her marriage, which is supposed to happen 2 days later. In that fear, she called police, saying that I am following her. I could have escaped from the place before police had come, but I was stopped and questioned by people ( as she told them that I am an unknown person, and I was misbehaving with her). The police came and arrested me after 30 mins. I didn't resist arrest. I gave them my ID proof and all the details they need and explained the situation. They made me wait for 4 hrs, because the girl wants her father to come to the police station, and speak to the police only in her father's presence. The police meanwhile took my mobile phones and made calls to everyone on the contact list, because I refused to give my father phone number as my parents are very sensitive. Meanwhile the girl's father came to the police station and used abusive language ( I will f... your mother) , in front of the police. Then I reacted aggressively and told him to shut his mouth. Don't dare to talk about my mother. The police had beat me. The girl's father just gave the compliant and asked for sometime to file a case. The police took me into custody and kept in cell without shirt and pants, just because I have long hair and beard( I was planning to go to Lord venkateswara, Tirupathi..). I gave them the reason for growing the hair and beard. At last they called my father and made him wait for the entire night and left me at around 2 PM next day ( 8pm - 2 PM next day my total stay in lock-up) after my father and uncle signed an agreement, stating that I will never disturb the girl and their family. My main questions are? 1) can a police arrest me without filing a case 2) can a police keep me in lock-up for so long time, almost 16 hrs, after I had provided valid ID proof 3) can a police arrest me without informing me the valid reason according to the IPC or crpc sections 4) can a police use abusive language or beat a citizen who is not resisting the arrest 5) in my case the police didn't conduct a proper investigation, as they neither enquired nor they took statement from the public, who were present at the situation. What do you think sir/madam? 6) can the police make calls to my contacts without my consent?