Change rake tests tasks to use spec directory
Return record errors within json body for record invalid error
PeriodSerializer for serializing the period