There is ALOT going on here.
First you really need a lawyer. A child out of wed lock the mom automatically rules.
Yes you must establish your parenting rights. However bring a parenting plain to court. If you have been seeing the child regularly then offer a 50/50 physical,
legal custody.
Just in case the judge does NOT like your first parenting plain, create a step-up parenting plain which gives you 50/50 custody after so much time.
There is so much more I could say.
Read all you can.
Visit Custody Reform
http://www.custodyreform.com/Read there FAQ.