Timestamp Microservice

I created an express app and set up a route for API endpoint to take in an input.
How dose this microservice work?

Input "/api/date", with data format "2001-01-29" or ""Thu, Sep 29 1988". It should handle a valid date, and return the correct UTC string
Input "/api/unix". It should handle a valid unix date, and return the correct unix timestamp
An empty date parameter will also be valid, and return the current time in UTC format.
Otherwise return an object { error : "Invalid Date" }.

an example pic how API works