Completed server side implementation.