Can one build a server that uses a cc by sa database for computation but does not respond with the cc 4.0 without giving attribution or follwing the terms of cc 4.0?
To answer your question: no, since you are redistributing the material, you need to give attribution. Both to the original database as well as to the content if it is under a by-license.
Assuming you haven't modified the content under the license, then from the Attribution-ShareAlike 4.0 licence text you need only to
give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
You cannot redistribute without giving appropriate credit, but any reasonable manner can be interpreted quite leniently.
I would suggest that you both add the attribution in the API documentation, as well as strongly consider adding attribution notice in the actual API response, either in a