Added some parsing to controller

Not sure if I did it correctly or not.